﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Market.AbstractProduct;

namespace Market.Product
{
    /// <summary>
    /// 折扣收费
    /// </summary>
    public class CashRebate : CashSuper
    {
        /// <summary>
        /// 折扣度
        /// </summary>
        private double moneyRebate = 1d;

        public CashRebate(double moneyRebate)
        {
            this.moneyRebate = moneyRebate;
        }

        /// <summary>
        /// 进行打折
        /// </summary>
        /// <param name="money">原价</param>
        /// <returns>折扣后的价钱</returns>
        public override double AcceptCash(double money)
        {
            return money * moneyRebate;
        }
    }
}
